import 'package:flutter/material.dart';

class BackgroundContainer extends StatelessWidget {
  final String _name;
  final Widget _child;

  BackgroundContainer({
    Key key,
    String name,
    Widget child,
  })  : _name = name ?? 'assets/images/all_background.png',
        _child = child,
        super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage(_name),
          fit: BoxFit.fill,
        ),
      ),
      child: _child,
    );
  }
}
